Skip to content

[golanci.yaml.tmpl] disable modernize omitzero plugin with controller-gen#406

Merged
majewsky merged 1 commit intomainfrom
disable-modernize-omitzero-plugin
Nov 7, 2025
Merged

[golanci.yaml.tmpl] disable modernize omitzero plugin with controller-gen#406
majewsky merged 1 commit intomainfrom
disable-modernize-omitzero-plugin

Conversation

@notandy
Copy link
Copy Markdown
Contributor

@notandy notandy commented Nov 7, 2025

This plugin is breaking practically all kubernetes-operators that have
CRDs. The CRDs are generated from golang types, where the omitempty tag
for nested structs has an direct effect on the generated CRD - they just
don't work without omitempty.

  Error: api/v1/eviction_types.go:91:20: omitzero: Omitempty has no
  effect on nested struct fields (modernize)

Reference: https://github.com/cobaltcore-dev/openstack-hypervisor-operator/actions/runs/19146731726/job/54726200638

@notandy notandy force-pushed the disable-modernize-omitzero-plugin branch from 33f0e8b to cfa6dbb Compare November 7, 2025 12:35
@notandy notandy requested a review from majewsky November 7, 2025 12:35
This plugin is breaking practically all kubernetes-operators that have
CRDs. The CRDs are generated from golang types, where the omitempty tag
for nested structs has an direct effect on the generated CRD - they just
don't work without omitempty.

```
  Error: api/v1/eviction_types.go:91:20: omitzero: Omitempty has no
  effect on nested struct fields (modernize)
```
@notandy notandy force-pushed the disable-modernize-omitzero-plugin branch from cfa6dbb to 5e2d618 Compare November 7, 2025 12:36
@notandy notandy changed the title [golanci.yaml.tmpl] disable modernize omitzero plugin by default [golanci.yaml.tmpl] disable modernize omitzero plugin with controller-gen Nov 7, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 7, 2025

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/go-makefile-maker/internal/golangcilint 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/go-makefile-maker/internal/golangcilint/golangci_lint.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@majewsky majewsky merged commit 4253fc3 into main Nov 7, 2025
8 checks passed
@majewsky majewsky deleted the disable-modernize-omitzero-plugin branch November 7, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants